package com.soft.line.util.MP;


import com.alibaba.fastjson.JSONObject;

public class OpenIdUtil {

	public static String getOpenId (String code) {
		

		String url = "https://api.weixin.qq.com/sns/jscode2session?appid="
				+ SystemConstant.APP_ID + "&secret=" + SystemConstant.APP_SECRET + "&js_code="
				+ code + "&grant_type=authorization_code";
		
		String reString= HttpClientUtil.httpPost(url, null);
		
		JSONObject jsonObject = JSONObject.parseObject(reString);
		
		String openId=jsonObject.getString("openid");
		return openId;
	}
}
